
CC=gcc -g
AR=ar

LDHDPATH = -I ./include 
LDLIBS =-lm

LIBSRC=./src/


libcomp_api.a:
ifeq (TSN_FPGA,$(TYPE))
	$(CC) -o $(LIBSRC)tsmp_pkt_send_recv.o -c $(LIBSRC)tsmp_pkt_send_recv.c $(LDLIBS) $(LDLIBS2) $(LDHDPATH)
else ifeq (TSN_SIM,$(TYPE))
	$(CC) -o $(LIBSRC)tsmp_data_rec_engine.o -c $(LIBSRC)tsmp_data_rec_engine_sim.c $(LDLIBS) $(LDLIBS2) $(LDHDPATH)
	$(CC) -o $(LIBSRC)tsmp_data_send_engine.o -c $(LIBSRC)tsmp_data_send_engine_sim.c $(LDLIBS) $(LDLIBS2) $(LDHDPATH)
endif
	$(CC) -o $(LIBSRC)tsninsight.o -c $(LIBSRC)tsninsight.c $(LDLIBS) $(LDLIBS2) $(LDHDPATH)
	$(CC) -o $(LIBSRC)tsmp_reg_cfg.o -c $(LIBSRC)tsmp_reg_cfg.c $(LDLIBS) $(LDLIBS2) $(LDHDPATH)
ifeq (TSN_FPGA,$(TYPE))
	$(AR) -rc $(TSMPAPI)libcomp_api.a $(LIBSRC)tsninsight.o $(LIBSRC)tsmp_pkt_send_recv.o  $(LIBSRC)tsmp_reg_cfg.o 
else ifeq (TSN_SIM,$(TYPE))	
	$(AR) -rc $(TSMPAPI)libcomp_api.a $(LIBSRC)tsninsight.o $(LIBSRC)tsmp_data_rec_engine.o $(LIBSRC)tsmp_data_send_engine.o $(LIBSRC)tsmp_reg_cfg.o 
endif

clean:
	rm -rf $(LIBSRC)*.o *.a 